1 2 3 if ( has_post_thumbnail() ) { the_post_thumbnail('medium', array('class' => 'alignleft')); }